package com.mydemo.design_pattern.action_type.observer_pattern.impl;

import com.mydemo.design_pattern.action_type.observer_pattern.Observer;
import com.mydemo.design_pattern.action_type.observer_pattern.Subject;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: OctalObserver, v1.0 2019-09-23 15:08 liming1 Exp $
 */
public class OctalObserver extends Observer {

    public OctalObserver(Subject subject){
        this.subject = subject;
        this.subject.addObserver(this);
    }

    @Override
    public void update() {
        System.out.println( "Octal String: "
                + Integer.toOctalString( subject.getState() ) );
    }
}
